<template>
	<view style="width: 100vw;position: relative;overflow-x:hidden;height: 100vh;overflow-y:scroll;">
		<image class="bgImage" src="/static/image/guide/homeBg.png" mode="widthFix"></image>
		<view class="renwuBox">
			<image :style="{opacity:selectIndex == 1?1:0}" src="https://cdn.yic3.cn/lawyer/images/aiNew1.png"
				mode="widthFix">
			</image>
			<image :style="{opacity:selectIndex == 2?1:0}" src="https://cdn.yic3.cn/lawyer/images/aiNew2.png"
				mode="widthFix">
			</image>
		</view>
		<view class="box1" :class="isOk?'hiddenBox':''">
			<image class="image1" src="https://cdn.yic3.cn/lawyer/mp-xhs/guide/icon10.png" mode="widthFix"></image>
			<view class="selectBox">
				<image @click="selectIndex=1"
					:src="selectIndex==1?'https://cdn.yic3.cn/lawyer/mp-xhs/guide/icon9.png':'https://cdn.yic3.cn/lawyer/mp-xhs/guide/icon8.png' "
					mode="widthFix"></image>
				<image @click="selectIndex=2"
					:src="selectIndex==1?'https://cdn.yic3.cn/lawyer/mp-xhs/guide/icon6.png':'https://cdn.yic3.cn/lawyer/mp-xhs/guide/icon7.png' "
					mode="widthFix"></image>
			</view>
			<view class="loginBtn" @click="choiceOk">
				选好了
			</view>
		</view>
		<view class="selected" :class="isOk?'showBox':''">
			<p class="text1">Hello，你好！</p>
			<p class="text2">我是你的专属法律助理，AI小律</p>
			<p class="text3">我会问你几个问题，以便根据你的需求更好的定制应用</p>
			<p class="text4" @click="goNext(1)">开启法律探索之旅</p>
			<p class="text5" @click="goNext(2)">不了，我自己了解</p>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				selectIndex: 1,
				isOk: false
			};
		},
		methods: {
			goNext(e) {
				if (e == 1) {
					
					// #ifdef MP-WEIXIN
					wx.reportEvent("guide_open_travel", {
						"start_exploring": 1,
					})
					// #endif
					// #ifdef APP
					plus.statistic.eventTrig('guide_select_lawyer',`{value:${e==1?'开启法律探索之旅':'不了，我自己了解'}}`)
					this.$api.userEvent({
						type: 'click',
						key: 'guide_open_travel',
						value: "open_travel",
						extra: e==1?'开启法律探索之旅':'不了，我自己了解'
					}).then(res => {})
					// #endif
					this.goRoute('/guide/pages/guide_4/guide_4')
				} else {
					this.goRoute('/guide/pages/guide_5/guide_5')
					// #ifdef MP-WEIXIN
					wx.reportEvent("guide_open_travel", {
						"own_know": 1
					})
					// #endif

				}
			},
			// 选好了
			choiceOk() {
				this.isOk = true
				// #ifdef MP-WEIXIN
				wx.reportEvent("guide_select_lawyer", {
				})
				// #endif
				// #ifdef APP
				plus.statistic.eventTrig('guide_select_lawyer')
				// #endif
				uni.setStorageSync('selectRenWu', this.selectIndex)
			}
		}
	}
</script>

<style lang="scss">
	@import 'guide_3.scss'
</style>
<style>
	page {
		background-color: #18171D;
		width: 100vw;
		position: relative;
	}
</style>